#include "directive.h"

struct directive 
{
	char *name;
	int code;
};

static struct directive directives [32] = 
{
	{".text", TEXT},
	{".data", DATA},
	{".word", WORD},
	{".string", STRING},
	{".global", GLOBAL},
	{0, INVALID}
};

int lookup_directive (char *name)
{
	int i;
	for (i = 0; directives [i].name; i ++)
	{
		if (! strcmp (name, directives [i].name))
		{
			return directives [i].code;
		}
	}
	return -1;
}

